// 首页导航模型
const { Navigation } = require('../../../models/navigation');
// 统一数据返回类
const { DataReturn } = require('../../../common/returnclass');

/**
 * @api {Get} /links 查询导航链接
 * @apiGroup Admin-Links
 *
 * @apiSuccess {ObjectId} _id 导航id
 * @apiSuccess {ObjectId} cate_id 分类id
 * @apiSuccess {String} icon  图标地址
 * @apiSuccess {String} title  返回消息
 * @apiSuccess {String} add_time  返回消息
 */
module.exports = async (req, res) => {
	 
	let navs = await Navigation.find();
	
	if (!navs) return DataReturn.getData(res,400,[],'暂无数据');
	
	DataReturn.getData(res,200, navs,'查询导航链接成功');

}